/**
 * 自动化注册公共组件
 * */
 const install = (Vue) => {
  const requireComponent = require.context('./', false, /\.vue$/);
  requireComponent.keys().forEach(filename => {
    const componentConfig = requireComponent(filename);

    const componentName = filename.replace(/^\.\//, '').replace(/\.vue$/, '');

    Vue.component(componentName, componentConfig.default || componentConfig)
  });
}

export default {
  install
}